<template>
  <div>
    <loading-btn :click="handleClick">
      <slot>提交请求</slot>
    </loading-btn>
  </div>
</template>
<script setup>
import LoadingBtn from './comp.vue'
const params = ref({
  name: 'zs',
  age: 18
})
const sleep = (time) => {
  return new Promise((resolve, reject) => {
    setTimeout(() => {
      resolve('成功')
    }, time)
  })
}
const handleClick = async () => {
  console.log('点击了')
  await sleep(2000)
}
</script>